package com.queming.music.mapper;

import com.queming.core.mapper.FileMapper;
import com.queming.core.mapper.MapperInterface;
import com.queming.music.dto.PlayListCreateRequest;
import com.queming.music.dto.PlayListDto;
import com.queming.music.entity.Playlist;
import com.queming.music.vo.PlayListVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.NullValueCheckStrategy;
import org.mapstruct.NullValuePropertyMappingStrategy;

/**
 *
 * @author 陈词调
 * @date 2022/5/5
 */
@Mapper(componentModel = "spring", uses = {FileMapper.class}, nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface PlayListMapper extends MapperInterface<Playlist,PlayListDto> {
    @Mapping(source = "coverId", target = "cover.id")
    PlayListDto toDto(PlayListCreateRequest playlistCreateRequest);
    PlayListVo toVo(PlayListDto playListDto);
}
